Left Termination of the query pattern mergesort_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

mergesort([], []).
mergesort(.(X, []), .(X, [])).
mergesort(.(X, .(Y, L1)), L2) :- ','(split2(.(X, .(Y, L1)), L3, L4), ','(mergesort(L3, L5), ','(mergesort(L4, L6), merge(L5, L6, L2)))).
split(L1, L2, L3) :- split0(L1, L2, L3).
split(L1, L2, L3) :- split1(L1, L2, L3).
split(L1, L2, L3) :- split2(L1, L2, L3).
split0([], [], []).
split1(.(X, []), .(X, []), []).
split2(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) :- split(L1, L2, L3).
merge([], L1, L1).
merge(L1, [], L1).
merge(.(X, L1), .(Y, L2), .(X, L3)) :- ','(le(X, Y), merge(L1, .(Y, L2), L3)).
merge(.(X, L1), .(Y, L2), .(Y, L3)) :- ','(gt(X, Y), merge(.(X, L1), L2, L3)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(X), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(Y)).
le(0, 0).

Queries:

mergesort(g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergesort_in: (b,f)
split2_in: (b,f,f)
split_in: (b,f,f)
merge_in: (b,b,f)
le_in: (b,b)
gt_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → SPLIT2_IN_GAA(.(X, .(Y, L1)), L3, L4)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_GAA(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U5_GAA(L1, L2, L3, split0_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT0_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U6_GAA(L1, L2, L3, split1_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT1_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U7_GAA(L1, L2, L3, split2_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_GA(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_GA(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → MERGE_IN_GGA(L5, L6, L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U14_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_GGA(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U13_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_GGA(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x3, x6)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x5, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x1, x2, x6)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x4)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
U13_GG(x1, x2, x3)  =  U13_GG(x3)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x4)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U14_GG(x1, x2, x3)  =  U14_GG(x3)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
SPLIT0_IN_GAA(x1, x2, x3)  =  SPLIT0_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x4)
SPLIT1_IN_GAA(x1, x2, x3)  =  SPLIT1_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → SPLIT2_IN_GAA(.(X, .(Y, L1)), L3, L4)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_GAA(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U5_GAA(L1, L2, L3, split0_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT0_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U6_GAA(L1, L2, L3, split1_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT1_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U7_GAA(L1, L2, L3, split2_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_GA(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_GA(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → MERGE_IN_GGA(L5, L6, L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U14_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_GGA(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U13_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_GGA(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x3, x6)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x5, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x1, x2, x6)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x4)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
U13_GG(x1, x2, x3)  =  U13_GG(x3)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x4)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U14_GG(x1, x2, x3)  =  U14_GG(x3)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
SPLIT0_IN_GAA(x1, x2, x3)  =  SPLIT0_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x4)
SPLIT1_IN_GAA(x1, x2, x3)  =  SPLIT1_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 5 SCCs with 16 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, le_out_gg) → MERGE_IN_GGA(L1, .(Y, L2))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U11_GGA(X, L1, Y, L2, gt_in_gg(X, Y))
U11_GGA(X, L1, Y, L2, gt_out_gg) → MERGE_IN_GGA(.(X, L1), L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U13_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U13_gg(gt_out_gg) → gt_out_gg
U14_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

gt_in_gg(x0, x1)
le_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U11_GGA(X, L1, Y, L2, gt_in_gg(X, Y))
The remaining pairs can at least be oriented weakly.

U9_GGA(X, L1, Y, L2, le_out_gg) → MERGE_IN_GGA(L1, .(Y, L2))
U11_GGA(X, L1, Y, L2, gt_out_gg) → MERGE_IN_GGA(.(X, L1), L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(MERGE_IN_GGA(x1, x2)) = x2   
POL(U11_GGA(x1, x2, x3, x4, x5)) = x4   
POL(U13_gg(x1)) = 0   
POL(U14_gg(x1)) = 1   
POL(U9_GGA(x1, x2, x3, x4, x5)) = 1 + x4   
POL(gt_in_gg(x1, x2)) = 0   
POL(gt_out_gg) = 0   
POL(le_in_gg(x1, x2)) = 1 + x1   
POL(le_out_gg) = 0   
POL(s(x1)) = 1 + x1   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, le_out_gg) → MERGE_IN_GGA(L1, .(Y, L2))
U11_GGA(X, L1, Y, L2, gt_out_gg) → MERGE_IN_GGA(.(X, L1), L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U13_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U13_gg(gt_out_gg) → gt_out_gg
U14_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

gt_in_gg(x0, x1)
le_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
QDP
                                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, le_out_gg) → MERGE_IN_GGA(L1, .(Y, L2))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))

The TRS R consists of the following rules:

gt_in_gg(s(X), s(Y)) → U13_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U13_gg(gt_out_gg) → gt_out_gg
U14_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

gt_in_gg(x0, x1)
le_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
QDP
                                    ↳ QReductionProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, le_out_gg) → MERGE_IN_GGA(L1, .(Y, L2))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U14_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

gt_in_gg(x0, x1)
le_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

gt_in_gg(x0, x1)
U13_gg(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
QDP
                                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, le_out_gg) → MERGE_IN_GGA(L1, .(Y, L2))
MERGE_IN_GGA(.(X, L1), .(Y, L2)) → U9_GGA(X, L1, Y, L2, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U14_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
U14_gg(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAA(L1) → SPLIT2_IN_GAA(L1)
SPLIT2_IN_GAA(.(X, .(Y, L1))) → SPLIT_IN_GAA(L1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x3, x6)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1))) → U1_GA(split2_in_gaa(.(X, .(Y, L1))))
U1_GA(split2_out_gaa(L3, L4)) → U2_GA(L4, mergesort_in_ga(L3))
U1_GA(split2_out_gaa(L3, L4)) → MERGESORT_IN_GA(L3)
U2_GA(L4, mergesort_out_ga(L5)) → MERGESORT_IN_GA(L4)

The TRS R consists of the following rules:

mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, L1))) → U1_ga(split2_in_gaa(.(X, .(Y, L1))))
split2_in_gaa(.(X, .(Y, L1))) → U8_gaa(X, Y, split_in_gaa(L1))
split_in_gaa(L1) → U5_gaa(split0_in_gaa(L1))
split0_in_gaa([]) → split0_out_gaa([], [])
U5_gaa(split0_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
split_in_gaa(L1) → U6_gaa(split1_in_gaa(L1))
split1_in_gaa(.(X, [])) → split1_out_gaa(.(X, []), [])
U6_gaa(split1_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
split_in_gaa(L1) → U7_gaa(split2_in_gaa(L1))
U7_gaa(split2_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
U8_gaa(X, Y, split_out_gaa(L2, L3)) → split2_out_gaa(.(X, L2), .(Y, L3))
U1_ga(split2_out_gaa(L3, L4)) → U2_ga(L4, mergesort_in_ga(L3))
U2_ga(L4, mergesort_out_ga(L5)) → U3_ga(L5, mergesort_in_ga(L4))
U3_ga(L5, mergesort_out_ga(L6)) → U4_ga(merge_in_gga(L5, L6))
merge_in_gga([], L1) → merge_out_gga(L1)
merge_in_gga(L1, []) → merge_out_gga(L1)
merge_in_gga(.(X, L1), .(Y, L2)) → U9_gga(X, L1, Y, L2, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U14_gg(le_out_gg) → le_out_gg
U9_gga(X, L1, Y, L2, le_out_gg) → U10_gga(X, merge_in_gga(L1, .(Y, L2)))
merge_in_gga(.(X, L1), .(Y, L2)) → U11_gga(X, L1, Y, L2, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U13_gg(gt_out_gg) → gt_out_gg
U11_gga(X, L1, Y, L2, gt_out_gg) → U12_gga(Y, merge_in_gga(.(X, L1), L2))
U12_gga(Y, merge_out_gga(L3)) → merge_out_gga(.(Y, L3))
U10_gga(X, merge_out_gga(L3)) → merge_out_gga(.(X, L3))
U4_ga(merge_out_gga(L2)) → mergesort_out_ga(L2)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split2_in_gaa(x0)
split_in_gaa(x0)
split0_in_gaa(x0)
U5_gaa(x0)
split1_in_gaa(x0)
U6_gaa(x0)
U7_gaa(x0)
U8_gaa(x0, x1, x2)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U14_gg(x0)
U9_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U13_gg(x0)
U11_gga(x0, x1, x2, x3, x4)
U12_gga(x0, x1)
U10_gga(x0, x1)
U4_ga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U1_GA(split2_out_gaa(L3, L4)) → U2_GA(L4, mergesort_in_ga(L3))
U1_GA(split2_out_gaa(L3, L4)) → MERGESORT_IN_GA(L3)
The remaining pairs can at least be oriented weakly.

MERGESORT_IN_GA(.(X, .(Y, L1))) → U1_GA(split2_in_gaa(.(X, .(Y, L1))))
U2_GA(L4, mergesort_out_ga(L5)) → MERGESORT_IN_GA(L4)
Used ordering: Combined order from the following AFS and order.
MERGESORT_IN_GA(x1)  =  MERGESORT_IN_GA(x1)
.(x1, x2)  =  .(x2)
U1_GA(x1)  =  x1
split2_in_gaa(x1)  =  split2_in_gaa(x1)
split2_out_gaa(x1, x2)  =  split2_out_gaa(x1, x2)
U2_GA(x1, x2)  =  U2_GA(x1)
mergesort_in_ga(x1)  =  x1
mergesort_out_ga(x1)  =  x1
gt_in_gg(x1, x2)  =  x2
s(x1)  =  s
0  =  0
gt_out_gg  =  gt_out_gg
U2_ga(x1, x2)  =  U2_ga
U3_ga(x1, x2)  =  U3_ga(x1, x2)
U4_ga(x1)  =  U4_ga
merge_out_gga(x1)  =  merge_out_gga(x1)
le_in_gg(x1, x2)  =  le_in_gg
le_out_gg  =  le_out_gg
U1_ga(x1)  =  U1_ga
U5_gaa(x1)  =  x1
split0_out_gaa(x1, x2)  =  split0_out_gaa(x1, x2)
split_out_gaa(x1, x2)  =  split_out_gaa(x1, x2)
U14_gg(x1)  =  U14_gg(x1)
U8_gaa(x1, x2, x3)  =  U8_gaa(x3)
U12_gga(x1, x2)  =  U12_gga(x1, x2)
split_in_gaa(x1)  =  split_in_gaa(x1)
U6_gaa(x1)  =  x1
split1_in_gaa(x1)  =  split1_in_gaa(x1)
merge_in_gga(x1, x2)  =  x2
U11_gga(x1, x2, x3, x4, x5)  =  x3
U9_gga(x1, x2, x3, x4, x5)  =  x2
U10_gga(x1, x2)  =  x1
[]  =  []
split0_in_gaa(x1)  =  split0_in_gaa
U7_gaa(x1)  =  x1
split1_out_gaa(x1, x2)  =  split1_out_gaa(x1, x2)
U13_gg(x1)  =  x1

Recursive path order with status [2].
Quasi-Precedence:
0 > [s, leingg, leoutgg] > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
gtoutgg > U12gga2 > [.1, U8gaa1] > split2outgaa2 > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
gtoutgg > U12gga2 > [.1, U8gaa1] > [s, leingg, leoutgg] > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
gtoutgg > U12gga2 > [.1, U8gaa1] > [splitingaa1, split1ingaa1, split0ingaa] > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
gtoutgg > U12gga2 > mergeoutgga1 > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
U2ga > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
U3ga2 > U4ga > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
U1ga > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]
U14gg1 > [s, leingg, leoutgg] > [MERGESORTINGA1, split2ingaa1, U2GA1, split0outgaa2, splitoutgaa2, [], split1outgaa2]

Status:
split1ingaa1: multiset
[]: multiset
split0ingaa: multiset
0: multiset
s: multiset
U1ga: []
U4ga: multiset
split2outgaa2: [2,1]
split2ingaa1: multiset
U2ga: multiset
leoutgg: multiset
U2GA1: multiset
splitingaa1: multiset
U14gg1: multiset
splitoutgaa2: multiset
U3ga2: [1,2]
U12gga2: [2,1]
leingg: []
.1: multiset
split0outgaa2: multiset
split1outgaa2: multiset
mergeoutgga1: [1]
MERGESORTINGA1: multiset
U8gaa1: multiset
gtoutgg: multiset


The following usable rules [17] were oriented:

U5_gaa(split0_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
U8_gaa(X, Y, split_out_gaa(L2, L3)) → split2_out_gaa(.(X, L2), .(Y, L3))
split_in_gaa(L1) → U6_gaa(split1_in_gaa(L1))
split0_in_gaa([]) → split0_out_gaa([], [])
split_in_gaa(L1) → U7_gaa(split2_in_gaa(L1))
U6_gaa(split1_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
split1_in_gaa(.(X, [])) → split1_out_gaa(.(X, []), [])
split2_in_gaa(.(X, .(Y, L1))) → U8_gaa(X, Y, split_in_gaa(L1))
split_in_gaa(L1) → U5_gaa(split0_in_gaa(L1))
U7_gaa(split2_out_gaa(L2, L3)) → split_out_gaa(L2, L3)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1))) → U1_GA(split2_in_gaa(.(X, .(Y, L1))))
U2_GA(L4, mergesort_out_ga(L5)) → MERGESORT_IN_GA(L4)

The TRS R consists of the following rules:

mergesort_in_ga([]) → mergesort_out_ga([])
mergesort_in_ga(.(X, [])) → mergesort_out_ga(.(X, []))
mergesort_in_ga(.(X, .(Y, L1))) → U1_ga(split2_in_gaa(.(X, .(Y, L1))))
split2_in_gaa(.(X, .(Y, L1))) → U8_gaa(X, Y, split_in_gaa(L1))
split_in_gaa(L1) → U5_gaa(split0_in_gaa(L1))
split0_in_gaa([]) → split0_out_gaa([], [])
U5_gaa(split0_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
split_in_gaa(L1) → U6_gaa(split1_in_gaa(L1))
split1_in_gaa(.(X, [])) → split1_out_gaa(.(X, []), [])
U6_gaa(split1_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
split_in_gaa(L1) → U7_gaa(split2_in_gaa(L1))
U7_gaa(split2_out_gaa(L2, L3)) → split_out_gaa(L2, L3)
U8_gaa(X, Y, split_out_gaa(L2, L3)) → split2_out_gaa(.(X, L2), .(Y, L3))
U1_ga(split2_out_gaa(L3, L4)) → U2_ga(L4, mergesort_in_ga(L3))
U2_ga(L4, mergesort_out_ga(L5)) → U3_ga(L5, mergesort_in_ga(L4))
U3_ga(L5, mergesort_out_ga(L6)) → U4_ga(merge_in_gga(L5, L6))
merge_in_gga([], L1) → merge_out_gga(L1)
merge_in_gga(L1, []) → merge_out_gga(L1)
merge_in_gga(.(X, L1), .(Y, L2)) → U9_gga(X, L1, Y, L2, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U14_gg(le_out_gg) → le_out_gg
U9_gga(X, L1, Y, L2, le_out_gg) → U10_gga(X, merge_in_gga(L1, .(Y, L2)))
merge_in_gga(.(X, L1), .(Y, L2)) → U11_gga(X, L1, Y, L2, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U13_gg(gt_out_gg) → gt_out_gg
U11_gga(X, L1, Y, L2, gt_out_gg) → U12_gga(Y, merge_in_gga(.(X, L1), L2))
U12_gga(Y, merge_out_gga(L3)) → merge_out_gga(.(Y, L3))
U10_gga(X, merge_out_gga(L3)) → merge_out_gga(.(X, L3))
U4_ga(merge_out_gga(L2)) → mergesort_out_ga(L2)

The set Q consists of the following terms:

mergesort_in_ga(x0)
split2_in_gaa(x0)
split_in_gaa(x0)
split0_in_gaa(x0)
U5_gaa(x0)
split1_in_gaa(x0)
U6_gaa(x0)
U7_gaa(x0)
U8_gaa(x0, x1, x2)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)
merge_in_gga(x0, x1)
le_in_gg(x0, x1)
U14_gg(x0)
U9_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U13_gg(x0)
U11_gga(x0, x1, x2, x3, x4)
U12_gga(x0, x1)
U10_gga(x0, x1)
U4_ga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergesort_in: (b,f)
split2_in: (b,f,f)
split_in: (b,f,f)
merge_in: (b,b,f)
le_in: (b,b)
gt_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → SPLIT2_IN_GAA(.(X, .(Y, L1)), L3, L4)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_GAA(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U5_GAA(L1, L2, L3, split0_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT0_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U6_GAA(L1, L2, L3, split1_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT1_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U7_GAA(L1, L2, L3, split2_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_GA(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_GA(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → MERGE_IN_GGA(L5, L6, L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U14_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_GGA(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U13_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_GGA(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x5, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x1, x2, x3, x5, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x1, x2, x3, x6)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x4)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
U13_GG(x1, x2, x3)  =  U13_GG(x1, x2, x3)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U14_GG(x1, x2, x3)  =  U14_GG(x1, x2, x3)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
SPLIT0_IN_GAA(x1, x2, x3)  =  SPLIT0_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x1, x4)
SPLIT1_IN_GAA(x1, x2, x3)  =  SPLIT1_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → SPLIT2_IN_GAA(.(X, .(Y, L1)), L3, L4)
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_GAA(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U5_GAA(L1, L2, L3, split0_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT0_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U6_GAA(L1, L2, L3, split1_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT1_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → U7_GAA(L1, L2, L3, split2_in_gaa(L1, L2, L3))
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_GA(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_GA(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
U3_GA(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → MERGE_IN_GGA(L5, L6, L2)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U14_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_GGA(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U13_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_GGA(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x5, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x1, x2, x3, x5, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x3, x5)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x1, x2, x3, x6)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x1, x4)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
U13_GG(x1, x2, x3)  =  U13_GG(x1, x2, x3)
U6_GAA(x1, x2, x3, x4)  =  U6_GAA(x1, x4)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U14_GG(x1, x2, x3)  =  U14_GG(x1, x2, x3)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
SPLIT0_IN_GAA(x1, x2, x3)  =  SPLIT0_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4)  =  U7_GAA(x1, x4)
SPLIT1_IN_GAA(x1, x2, x3)  =  SPLIT1_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 5 SCCs with 16 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U9_GGA(X, L1, Y, L2, L3, le_out_gg(X, Y)) → MERGE_IN_GGA(L1, .(Y, L2), L3)
U11_GGA(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → MERGE_IN_GGA(.(X, L1), L2, L3)
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(Y, L3)) → U11_GGA(X, L1, Y, L2, L3, gt_in_gg(X, Y))
MERGE_IN_GGA(.(X, L1), .(Y, L2), .(X, L3)) → U9_GGA(X, L1, Y, L2, L3, le_in_gg(X, Y))

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
MERGE_IN_GGA(x1, x2, x3)  =  MERGE_IN_GGA(x1, x2)
U11_GGA(x1, x2, x3, x4, x5, x6)  =  U11_GGA(x1, x2, x3, x4, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT2_IN_GAA(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → SPLIT_IN_GAA(L1, L2, L3)
SPLIT_IN_GAA(L1, L2, L3) → SPLIT2_IN_GAA(L1, L2, L3)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
SPLIT2_IN_GAA(x1, x2, x3)  =  SPLIT2_IN_GAA(x1)
SPLIT_IN_GAA(x1, x2, x3)  =  SPLIT_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GA(.(X, .(Y, L1)), L2) → U1_GA(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → MERGESORT_IN_GA(L3, L5)
U1_GA(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_GA(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_GA(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → MERGESORT_IN_GA(L4, L6)

The TRS R consists of the following rules:

mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(X, []), .(X, [])) → mergesort_out_ga(.(X, []), .(X, []))
mergesort_in_ga(.(X, .(Y, L1)), L2) → U1_ga(X, Y, L1, L2, split2_in_gaa(.(X, .(Y, L1)), L3, L4))
split2_in_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3)) → U8_gaa(X, Y, L1, L2, L3, split_in_gaa(L1, L2, L3))
split_in_gaa(L1, L2, L3) → U5_gaa(L1, L2, L3, split0_in_gaa(L1, L2, L3))
split0_in_gaa([], [], []) → split0_out_gaa([], [], [])
U5_gaa(L1, L2, L3, split0_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U6_gaa(L1, L2, L3, split1_in_gaa(L1, L2, L3))
split1_in_gaa(.(X, []), .(X, []), []) → split1_out_gaa(.(X, []), .(X, []), [])
U6_gaa(L1, L2, L3, split1_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
split_in_gaa(L1, L2, L3) → U7_gaa(L1, L2, L3, split2_in_gaa(L1, L2, L3))
U7_gaa(L1, L2, L3, split2_out_gaa(L1, L2, L3)) → split_out_gaa(L1, L2, L3)
U8_gaa(X, Y, L1, L2, L3, split_out_gaa(L1, L2, L3)) → split2_out_gaa(.(X, .(Y, L1)), .(X, L2), .(Y, L3))
U1_ga(X, Y, L1, L2, split2_out_gaa(.(X, .(Y, L1)), L3, L4)) → U2_ga(X, Y, L1, L2, L4, mergesort_in_ga(L3, L5))
U2_ga(X, Y, L1, L2, L4, mergesort_out_ga(L3, L5)) → U3_ga(X, Y, L1, L2, L5, mergesort_in_ga(L4, L6))
U3_ga(X, Y, L1, L2, L5, mergesort_out_ga(L4, L6)) → U4_ga(X, Y, L1, L2, merge_in_gga(L5, L6, L2))
merge_in_gga([], L1, L1) → merge_out_gga([], L1, L1)
merge_in_gga(L1, [], L1) → merge_out_gga(L1, [], L1)
merge_in_gga(.(X, L1), .(Y, L2), .(X, L3)) → U9_gga(X, L1, Y, L2, L3, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U14_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U14_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U9_gga(X, L1, Y, L2, L3, le_out_gg(X, Y)) → U10_gga(X, L1, Y, L2, L3, merge_in_gga(L1, .(Y, L2), L3))
merge_in_gga(.(X, L1), .(Y, L2), .(Y, L3)) → U11_gga(X, L1, Y, L2, L3, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U13_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U13_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U11_gga(X, L1, Y, L2, L3, gt_out_gg(X, Y)) → U12_gga(X, L1, Y, L2, L3, merge_in_gga(.(X, L1), L2, L3))
U12_gga(X, L1, Y, L2, L3, merge_out_gga(.(X, L1), L2, L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(Y, L3))
U10_gga(X, L1, Y, L2, L3, merge_out_gga(L1, .(Y, L2), L3)) → merge_out_gga(.(X, L1), .(Y, L2), .(X, L3))
U4_ga(X, Y, L1, L2, merge_out_gga(L5, L6, L2)) → mergesort_out_ga(.(X, .(Y, L1)), L2)

The argument filtering Pi contains the following mapping:
mergesort_in_ga(x1, x2)  =  mergesort_in_ga(x1)
[]  =  []
mergesort_out_ga(x1, x2)  =  mergesort_out_ga(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
split2_in_gaa(x1, x2, x3)  =  split2_in_gaa(x1)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x1, x2, x3, x6)
split_in_gaa(x1, x2, x3)  =  split_in_gaa(x1)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x1, x4)
split0_in_gaa(x1, x2, x3)  =  split0_in_gaa(x1)
split0_out_gaa(x1, x2, x3)  =  split0_out_gaa(x1, x2, x3)
split_out_gaa(x1, x2, x3)  =  split_out_gaa(x1, x2, x3)
U6_gaa(x1, x2, x3, x4)  =  U6_gaa(x1, x4)
split1_in_gaa(x1, x2, x3)  =  split1_in_gaa(x1)
split1_out_gaa(x1, x2, x3)  =  split1_out_gaa(x1, x2, x3)
U7_gaa(x1, x2, x3, x4)  =  U7_gaa(x1, x4)
split2_out_gaa(x1, x2, x3)  =  split2_out_gaa(x1, x2, x3)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x1, x2, x3, x5, x6)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x3, x5)
merge_in_gga(x1, x2, x3)  =  merge_in_gga(x1, x2)
merge_out_gga(x1, x2, x3)  =  merge_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x1, x2, x3, x4, x6)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U14_gg(x1, x2, x3)  =  U14_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U10_gga(x1, x2, x3, x4, x5, x6)  =  U10_gga(x1, x2, x3, x4, x6)
U11_gga(x1, x2, x3, x4, x5, x6)  =  U11_gga(x1, x2, x3, x4, x6)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U13_gg(x1, x2, x3)  =  U13_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U12_gga(x1, x2, x3, x4, x5, x6)  =  U12_gga(x1, x2, x3, x4, x6)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x5, x6)
MERGESORT_IN_GA(x1, x2)  =  MERGESORT_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains